"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _jsxRuntime = require("react/jsx-runtime");

var _antdV = require("antd-v4");

var _classnames2 = _interopRequireDefault(require("classnames"));

var _react = _interopRequireWildcard(require("react"));

require("./index.less");

/**
 * 默认的 index 列容器，提供一个好看的 index
 *
 * @param param0
 */
var IndexColumn = function IndexColumn(_ref, ref) {
  var _classnames;

  var _ref$border = _ref.border,
      border = _ref$border === void 0 ? false : _ref$border,
      children = _ref.children;

  var _useContext = (0, _react.useContext)(_antdV.ConfigProvider.ConfigContext),
      getPrefixCls = _useContext.getPrefixCls;

  var className = getPrefixCls('pro-field-index-column');
  return (0, _jsxRuntime.jsx)("div", {
    ref: ref,
    className: (0, _classnames2.default)(className, (_classnames = {}, (0, _defineProperty2.default)(_classnames, "".concat(className, "-border"), border), (0, _defineProperty2.default)(_classnames, 'top-three', children > 3), _classnames)),
    children: children
  });
};

var _default = /*#__PURE__*/_react.default.forwardRef(IndexColumn);

exports.default = _default;